//change to ASCII 

import java.io.*;
import java.util.*;

public class Main{
	public static void main(String[] args){
		try{
//			PushbackInputStream pushbackinputstream=new PushbackInputStream(new FileInputStream(new File(args[0])));
			PushbackInputStream pushbackinputstream=new PushbackInputStream(new FileInputStream(args[0]));

			byte[] array=new byte[2];
			int tmp=0;
			int count=0;

			while((count=pushbackinputstream.read(array))!=-1){
				tmp=(short)((array[0]<<8)|array[1]&0xFF);

				tmp=tmp&0xFFFF;

				if(tmp>=0xA440 && tmp<0xFFFF){
					System.out.println("BIG5:"+new String(array));				
				}
				else{
					if(count==2)
					pushbackinputstream.unread(array,1,1);
					System.out.println("ASCII:"+(char)array[0]);
				}

System.out.println(array[0]);
System.out.println(array[1]);
System.out.println(count);
			}
			pushbackinputstream.close();

		}
		catch(ArrayIndexOutOfBoundsException e){
			e.printStackTrace();
		}
		catch(IOException e){
			e.printStackTrace();
		}
	}
}